<template>
  <basic-container shadow="never">
    <el-container style="height: 100%">
      <basic-container>
        <el-aside width="300px">

          <dept-list ref="deptList" @clickTreeNode="clickDeptTreeNode"></dept-list>

        </el-aside>
      </basic-container>

      <el-main style="height: 100%">
        <basic-container>
          <el-divider content-position="left">系统用户</el-divider>
          <div style="padding-left: 10px">
            <user-list :user-search-param="userSearchParam" ref="userList" @search-reset="searchReset"></user-list>
          </div>
        </basic-container>
      </el-main>
    </el-container>
  </basic-container>
</template>

<script>


import UserList from "./userList.vue";

import DeptList from "./deptList.vue";


export default {
  components: {
    DeptList,
    UserList
  },
  data() {
    return {
      userSearchParam: {},
    }
  },
  methods: {
    searchReset() {
      this.$refs.deptList.clearCurrentKey();
      this.userSearchParam.start_search_deptId = null;
    },
    clickDeptTreeNode(dept) {
      dept = dept || {}
      this.userSearchParam.start_search_deptId = dept.id;
      this.$nextTick(() => {
        this.$refs.userList.refreshChange();
      })
    },

  }
}
</script>

<style scoped>

</style>
